//
//  LGCiTangGiveMoneyViewController.m
//  ligenyun
//
//  Created by Mac on 2018/3/27.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "LGCiTangGiveMoneyViewController.h"

@interface LGCiTangGiveMoneyViewController ()
@property(nonatomic, strong) UITextField                     *textFiled;
@end

@implementation LGCiTangGiveMoneyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"捐赠";
    [self configSubView];
    // Do any additional setup after loading the view.
}

#pragma mark --subView
- (void)configSubView{
    UIView * header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 20)];

    UIView * whiteView = [[UIView alloc] initWithFrame:CGRectMake(0, 20, UIScreenWidth, 30)];
    whiteView.layer.cornerRadius = 4;
    whiteView.clipsToBounds = YES;
    whiteView.backgroundColor = [UIColor whiteColor];
    [header addSubview:whiteView];

    __weak typeof(self) weakSelf =  self;
    STButton * sendButton = [[STButton alloc] initWithFrame:CGRectMake(0, 20, 60, 30)
                                                     title:@"捐赠"
                                                titleColor:[UIColor whiteColor]
                                                 titleFont:14
                                              cornerRadius:4
                                           backgroundColor:TM_redColor
                                           backgroundImage:nil
                                                     image:nil];
    sendButton.contentHorizontalAlignment = UIControlContentVerticalAlignmentCenter;
    [sendButton setClicAction:^(UIButton *sender) {
        if (!weakSelf.textFiled.text.length) {
            [SVProgressHUD showErrorWithStatus:@"请输入金额"];
        }else{
            [SVProgressHUD showSuccessWithStatus:@"捐赠成功"];
            [weakSelf.navigationController popViewControllerAnimated:YES];
        }
    }];
    sendButton.right = UIScreenWidth - 20;
    [header addSubview:sendButton];
    
    whiteView.left = 20;
    whiteView.width = sendButton.left - 15 - 20;
    
    self.textFiled = [[UITextField alloc] initWithFrame:CGRectMake(10, 0, whiteView.width - 30, 30)];
    self.textFiled.placeholder = @"请输入金币";
    self.textFiled.keyboardType = UIKeyboardTypeASCIICapableNumberPad;
    [whiteView addSubview:self.textFiled];
    
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(20, whiteView.bottom + 20, 300, 30)
                                                     text:@"捐赠金额单位为富币"
                                                textColor:SecendTextColor
                                                     font:14
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [header addSubview:titleLable];
    
    header.height = titleLable.bottom;
    self.tableView.tableHeaderView = header;
    
    
}


@end
